let arr1 = [1,2]
let arr2 = [1,3,3]

function distrub(arr1, arr2) {
    let child = arr1.sort((a,b) => {
        return a - b
    })
    let cookie = arr2.sort((a,b) => {
        return a - b
    })

    let num = 0 // 计数
    for(let i=0; i<cookie.length; i++) {
        if (cookie[i] >= child[num]){ {
            num++
        }}
    }
    return num
    // console.log(child, cookie)
}
console.log(distrub(arr1, arr2))